From bcd2bd2382e650f843dab1901446a1d2df8284ee Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Thu, 29 Sep 2005 17:29:23 -0600 Subject: [PATCH] Keep up with recent changes in xen-unstable --- .../arch/ia64/xen/drivers/evtchn_ia64.c | 11 ++++ .../ia64/xen/drivers/patches/gnttab.c.patch | 66 +++++++++---------- .../arch/ia64/xen/drivers/xenia64_init.c | 4 ++ 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c index e5c3a50f78..9f64f0ce4e 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/evtchn_ia64.c @@ -7,6 +7,9 @@ #include #define MAX_EVTCHN 256 + +#define VALID_EVTCHN(_chn) ((_chn) >= 0) + static struct { irqreturn_t (*handler)(int, void *, struct pt_regs *); void *dev_id; @@ -73,6 +76,14 @@ void unbind_evtchn_from_irq(unsigned int evtchn) while(1); } +void notify_remote_via_irq(int irq) +{ + int evtchn = virq_to_evtchn[irq]; // FIXME... is this right?? + + if (VALID_EVTCHN(evtchn)) + notify_remote_via_evtchn(evtchn); +} + irqreturn_t evtchn_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 l1, l2; diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch index 78ce7f768a..84d89e1825 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch @@ -1,7 +1,7 @@ diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c --- xen/core/gnttab.c 2005-09-23 10:54:50.000000000 -0600 +++ xen.patched/core/gnttab.c 2005-09-23 10:57:51.000000000 -0600 -@@ -22,6 +22,10 @@ +@@ -19,6 +19,10 @@ #include #include @@ -10,59 +10,59 @@ diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c +#endif + #if 1 - #define ASSERT(_p) \ - if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \ -@@ -339,6 +343,10 @@ - if ( hypercall.op != __HYPERVISOR_grant_table_op ) - return -ENOSYS; + #define ASSERT(_p) \ + if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \ +@@ -346,6 +350,10 @@ + if ( hypercall.op != __HYPERVISOR_grant_table_op ) + return -ENOSYS; + +#ifdef __ia64__ -+ ret = HYPERVISOR_grant_table_op(hypercall.arg[0], (void *)hypercall.arg[1], hypercall.arg[2]); ++ ret = HYPERVISOR_grant_table_op(hypercall.arg[0], (void *)hypercall.arg[1], hypercall.arg[2]); +#else - /* hypercall-invoking asm taken from privcmd.c */ - __asm__ __volatile__ ( - "pushl %%ebx; pushl %%ecx; pushl %%edx; pushl %%esi; pushl %%edi; " -@@ -351,6 +359,7 @@ - TRAP_INSTR "; " - "popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx" - : "=a" (ret) : "0" (&hypercall) : "memory" ); + /* hypercall-invoking asm taken from privcmd.c */ + __asm__ __volatile__ ( + "pushl %%ebx; pushl %%ecx; pushl %%edx; " +@@ -359,6 +367,7 @@ + TRAP_INSTR "; " + "popl %%edi; popl %%esi; popl %%edx; popl %%ecx; popl %%ebx" + : "=a" (ret) : "0" (&hypercall) : "memory" ); +#endif - return ret; + return ret; } -@@ -414,8 +423,13 @@ - BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1) != 0); - BUG_ON(setup.status != 0); +@@ -423,8 +432,13 @@ + BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1)); + BUG_ON(setup.status != 0); +#ifdef __ia64__ -+ shared = __va(frames[0] << PAGE_SHIFT); -+ printk("grant table at %p\n", shared); ++ shared = __va(frames[0] << PAGE_SHIFT); ++ printk("grant table at %p\n", shared); +#else - for ( i = 0; i < NR_GRANT_FRAMES; i++ ) - set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT); + for (i = 0; i < NR_GRANT_FRAMES; i++) + set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT); +#endif - return 0; + return 0; } -@@ -425,8 +439,10 @@ +@@ -434,8 +448,10 @@ { - int i; + int i; +#ifndef __ia64__ - for ( i = 0; i < NR_GRANT_FRAMES; i++ ) - clear_fixmap(FIX_GNTTAB_END - i); + for (i = 0; i < NR_GRANT_FRAMES; i++) + clear_fixmap(FIX_GNTTAB_END - i); +#endif - return 0; + return 0; } -@@ -441,7 +457,9 @@ +@@ -450,7 +466,9 @@ - BUG_ON(gnttab_resume()); + BUG_ON(gnttab_resume()); +#ifndef __ia64__ - shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END); + shared = (grant_entry_t *)fix_to_virt(FIX_GNTTAB_END); +#endif - for ( i = 0; i < NR_GRANT_ENTRIES; i++ ) - gnttab_list[i] = i + 1; + for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++) + gnttab_list[i] = i + 1; diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/xenia64_init.c b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/xenia64_init.c index 4696da61d3..0a16416895 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/xenia64_init.c +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/xenia64_init.c @@ -45,4 +45,8 @@ unsigned long alloc_empty_foreign_map_page_range(unsigned long pages) return (unsigned long)vma->addr; } + +/* These should be define'd but some drivers use them without + * a convenient arch include */ +unsigned long mfn_to_pfn(unsigned long mfn) { return mfn; } #endif -- 2.30.2